const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  mode: 'development',
  
  entry: './src/index.js',

  devtool: 'inline-source-map',

  devServer: {
    static: './dist/index.html'
  },
  
  output: {
    filename: 'app.js',
    path: path.resolve(__dirname, './dist'),
    clean: true,
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: './public/index.html',
      filename: 'index.html',
      inject: 'body'
    })
  ]
}